package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MyWorkstationMapper;
import com.ruoyi.system.domain.MyWorkstation;
import com.ruoyi.system.service.IMyWorkstationService;

/**
 * 工作站Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class MyWorkstationServiceImpl implements IMyWorkstationService 
{
    @Autowired
    private MyWorkstationMapper myWorkstationMapper;

    /**
     * 查询工作站
     * 
     * @param workstationId 工作站主键
     * @return 工作站
     */
    @Override
    public MyWorkstation selectMyWorkstationByWorkstationId(Long workstationId)
    {
        return myWorkstationMapper.selectMyWorkstationByWorkstationId(workstationId);
    }

    /**
     * 查询工作站列表
     * 
     * @param myWorkstation 工作站
     * @return 工作站
     */
    @Override
    public List<MyWorkstation> selectMyWorkstationList(MyWorkstation myWorkstation)
    {
        return myWorkstationMapper.selectMyWorkstationList(myWorkstation);
    }

    /**
     * 新增工作站
     * 
     * @param myWorkstation 工作站
     * @return 结果
     */
    @Override
    public int insertMyWorkstation(MyWorkstation myWorkstation)
    {
        myWorkstation.setCreateTime(DateUtils.getNowDate());
        return myWorkstationMapper.insertMyWorkstation(myWorkstation);
    }

    /**
     * 修改工作站
     * 
     * @param myWorkstation 工作站
     * @return 结果
     */
    @Override
    public int updateMyWorkstation(MyWorkstation myWorkstation)
    {
        myWorkstation.setUpdateTime(DateUtils.getNowDate());
        return myWorkstationMapper.updateMyWorkstation(myWorkstation);
    }

    /**
     * 批量删除工作站
     * 
     * @param workstationIds 需要删除的工作站主键
     * @return 结果
     */
    @Override
    public int deleteMyWorkstationByWorkstationIds(Long[] workstationIds)
    {
        return myWorkstationMapper.deleteMyWorkstationByWorkstationIds(workstationIds);
    }

    /**
     * 删除工作站信息
     * 
     * @param workstationId 工作站主键
     * @return 结果
     */
    @Override
    public int deleteMyWorkstationByWorkstationId(Long workstationId)
    {
        return myWorkstationMapper.deleteMyWorkstationByWorkstationId(workstationId);
    }
}
